//
// Created by Administrator on 2022/1/17.
// Procedurally Sphere
//

#ifndef OPENGLLEARN_2_SPHERE_H
#define OPENGLLEARN_2_SPHERE_H

#include "Common/Utils.h"
#include "glm/glm.hpp"
#include "glm/gtc/type_ptr.hpp"
#include <vector>

class Sphere
{
public:
    Sphere();
    explicit Sphere(int precision);
    int GetNumVertices() { return numVertices; }
    int GetNumIndices() { return numIndices; }
    std::vector<int> GetIndices() { return indices; }
    std::vector<glm::vec3> GetVertices() { return vertices; }
    std::vector<glm::vec2> GetUVs() { return uvs; }
    std::vector<glm::vec3> GetNormals() { return normals; }

private:
    void Init(int precision);
    int numVertices;
    int numIndices;
    std::vector<int> indices;
    std::vector<glm::vec3> vertices;
    std::vector<glm::vec2> uvs;
    std::vector<glm::vec3> normals;
};

#endif //OPENGLLEARN_2_SPHERE_H
